package com.imay.live.adapter;


import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.imay.live.R;
import com.imay.live.logic.NoticeListLogic;
import com.imay.live.model.NoticeMergeMineFollowModel;
import com.imay.live.utils.GlideUtil;

import java.util.List;

/**
 * Created by  nick on 2017/4/5 0005.
 * 通知, 我的,合并消息列表
 */

public class NoticeMergeListFollowAdapter extends  BaseQuickAdapter<NoticeMergeMineFollowModel, BaseViewHolder> {

    public NoticeMergeListFollowAdapter(int layoutResId, List data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NoticeMergeMineFollowModel item) {
        ImageView iv_notice_right = helper.getView(R.id.iv_notice_right);
        ImageView iv_notice_head_img = helper.getView(R.id.iv_notice_head_img);
        helper.setText(R.id.tv_notice_content,NoticeListLogic.getTextMineFollowMerge(mContext,item));

        ((TextView)helper.getView(R.id.tv_notice_content)).setMovementMethod(LinkMovementMethod.getInstance());//设置点击监听
        GlideUtil.loadCircleImage(iv_notice_head_img,item.getOperatorUser().getImgHead(),R.mipmap.pnl_00_head108);
        iv_notice_right.setVisibility(View.GONE);
        if (item.getEventType()!=1) {
            if (item.getFeed() != null) {
                GlideUtil.loadImage(iv_notice_right, item.getFeed().getUrl(), R.mipmap.placeholder);
                iv_notice_right.setVisibility(View.VISIBLE);

            }
        }

        helper.addOnClickListener(R.id.iv_notice_head_img);
        helper.addOnClickListener(R.id.iv_notice_right);



    }





}
